#include <bits/stdc++.h>
using namespace std;
int cnt, num, start;
int a[21];

void dfs(int x, int start) {

	if (x > num) {
		for (int i = 1; i <= num; i++) {
			printf("%3d", a[i]);
		}
		cout << endl;
		return ;
	}
	for (int i = start; i <= cnt; i++) {

			a[x] = i;
			dfs(x + 1, i + 1);
			a[x] = 0;
	}

}

int main() {
	cin >> cnt >> num;
	dfs(1, 1 );
	return 0;
}
